#ifndef KNAVETABBAR_H
#define KNAVETABBAR_H

#include "../screencapsdk_global.h"
#include <QTabBar>
#include <QIcon>
#include "kcustomtabbar.h"

namespace kdk
{

/** @defgroup BarModule
  * @since 2.5
  */

/**
 * @brief 支持三种样式
 */
enum KNativeTabbarStyle
{
    SegmentDark,
    SegmentLight,
    Sliding
};

class KNativeTabbarPrivate;

/**
 * @brief 支持三种样式
 */
class SCREENCAPSDK_EXPORT KNativeTabbar: public KCustomTabBar
{
    Q_OBJECT

public:
    KNativeTabbar(KNativeTabbarStyle barStyle = SegmentLight,QWidget* parent = nullptr);
    ~KNativeTabbar();

    /**
     * @brief 设置TabBar样式
     * @param barStyle
     */
    void setTabbarStyle(KNativeTabbarStyle barStyle);

    /**
     * @brief 返回TabBar样式
     * @return
     */
    KNativeTabbarStyle barStyle();

    /**
     * @brief 设置圆角半径，只对SegmentDark，SegmentLight样式生效
     * @param radius
     */
    void setBorderRadius(int radius);

    /**
     * @brief 获取圆角半径
     * @return
     */
    int borderRadius();

    /**
     * @brief 设置背景色
     * @param color
     */
    void setBackgroundColor(const QColor& color);
Q_SIGNALS:
    /**
     * @brief 鼠标右键信号
     * @param point
     */
    void rightlicked(QPoint point);
protected:
    QSize sizeHint() const;
    QSize minimumTabSizeHint(int index) const;
     QSize tabSizeHint(int index) const;
    void paintEvent(QPaintEvent *event);

private:
    Q_DECLARE_PRIVATE(KNativeTabbar)
    KNativeTabbarPrivate*const d_ptr;
};
}
/**
  * @example testtabbar/widget.h
  * @example testtabbar/widget.cpp
  * @}
  */
#endif //KNAVETABBAR_H
